package com.xcity.game.currency;

import com.xcity.game.io.DeserializeStream;

public interface ICurrencyFactory {

	ICurrency create(CurrencyType type, DeserializeStream stream);
	
	default ICurrency[] createAll() {
		int len = CurrencyType.size();
		CurrencyType[] types = CurrencyType.vals();
		ICurrency[] currencies = new ICurrency[len];
		for (int i = 0; i < len; i++) {
			CurrencyType type = types[i];
			currencies[i] = create(type, null);
		}
		return currencies;
	}
	
}
